﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="产品库存统计.aspx.cs" Inherits="syc.Store.产品库存统计" %>
<html>
<head>
</head>
<body>
<script type="text/javascript" language="javascript" src="/common.js"></script>

<form id="form1" runat="server">
<div id="wintop" class="wintop">产品库存查询统计</div>
<asp:Panel ID="Panel1" runat="server" GroupingText="产品库存查询统计" CssClass="panel">

<asp:SqlDataSource ID="DS_ChanPin" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="SELECT [ID],[品名]+' '+[钢级]+' '+[规格] AS 名称 FROM [产品]"></asp:SqlDataSource>
产品类别：<asp:DropDownList ID="ChanPin" runat="server" Width="150px" Font-Size="12px" DataSourceID="DS_ChanPin" DataTextField="名称" DataValueField="ID">

</asp:DropDownList>  

<span style="margin-left:10px;"></span>原料供货：<asp:DropDownList ID="GongHuo" runat="server" 
    DataSourceID="SqlDataSource2" DataTextField="名称" DataValueField="ID" 
    Width="120px">
</asp:DropDownList>
</span>

<span style="margin-left:10px;"></span>生产单位：<asp:DropDownList ID="FenChang" runat="server" Width="120px">
        <asp:ListItem Value="0">全部</asp:ListItem>
        <asp:ListItem Value="101">一分厂</asp:ListItem>
        <asp:ListItem Value="2">二分厂</asp:ListItem>
        <asp:ListItem Value="201">　二分厂B1</asp:ListItem>
        <asp:ListItem Value="202">　二分厂B2</asp:ListItem>
        <asp:ListItem Value="5">五分厂</asp:ListItem>
        <asp:ListItem Value="501">　五分厂C1</asp:ListItem>
        <asp:ListItem Value="502">　五分厂C2</asp:ListItem>
    </asp:DropDownList> 


<span style="margin-left:10px;"></span><asp:CheckBox ID="ChuKu" runat="server" />显示已出库产品

<div style="font-size:4px;height:4px;line-height:4px;"></div>

起始捆号：<asp:TextBox ID="KunHao" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>


<span style="margin-left:10px;"></span>入库日期：<asp:TextBox ID="Date1" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox></span><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date1').value, document.getElementById('Date1'));" />
至 <asp:TextBox ID="Date2" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox><img alt="" src="/Icons/29.png" align="middle" onclick="makecalendar(document.getElementById('Date2').value, document.getElementById('Date2'));" />

<span style="margin-left:40px;"></span><asp:Button ID="Button_All" runat="server" Text="清空条件" CssClass="mbutton" 
    UseSubmitBehavior="False" onclick="Button_All_Click" />

<div style="font-size:1px;height:1px;line-height:1px;"></div>

炉　　号：<asp:TextBox ID="LuHao" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>

<span style="margin-left:10px;"></span>捆 重 量：<asp:TextBox ID="KunZhong" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>

<span style="margin-left:10px;"></span>捆 长 度：<asp:TextBox ID="KunChang" runat="server" CssClass="intxt1" Width="120px"></asp:TextBox>

<span style="margin-left:13px;"></span>
<asp:Button ID="Button_Query" runat="server" Text="查询统计" CssClass="mbutton" 
    UseSubmitBehavior="False" onclick="Button_Query_Click" />

<asp:SqlDataSource ID="SqlDataSource2" runat="server" 
    ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
    SelectCommand="SELECT 0 as [ID], '全部' as [名称] UNION SELECT [ID], [名称] FROM [原料供货单位]"></asp:SqlDataSource>
<div style="height:6px;font-size:6px;line-height:6px;"></div>
<asp:Panel ID="Panel2" runat="server" CssClass="panel">
    <asp:Label ID="Label_Result" runat="server" Text="请点击按钮 “查询统计”" Font-Size="16px" Font-Bold="true" ForeColor="Red"></asp:Label>
</asp:Panel>
    
</asp:Panel>

<style> 
td.grid{cursor:default;}
</style>

<div class="gridframe">
    <div class="gridview">
    
        <table border="1" width="100%" cellspacing="0" cellpadding="0" bordercolor="#e5cfab">
            <tr>
	            <td class="grid-title">产品库存明细</td>
	        </tr>
	        <tr>
	            <td class="grid-back">
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:SCMConnectionString1 %>" 
                        onselected="SqlDataSource1_Selected" ></asp:SqlDataSource>
                    <asp:GridView ID="GridView1" runat="server" AllowPaging="True" 
                        AutoGenerateColumns="False" CssClass="grid" DataKeyNames="ID" 
                        DataSourceID="SqlDataSource1" 
                        GridLines="None" ondatabound="GridView1_DataBound" 
                        onpageindexchanged="GridView1_PageIndexChanged" AllowSorting="True" 
                        UseAccessibleHeader="False"  PageSize="20" >
                        <PagerSettings Visible="False" />
                        <RowStyle CssClass="grid-row-normal" />
                        <Columns>
                        
                           <asp:TemplateField HeaderText="捆编号" SortExpression="捆号">
                                <ItemTemplate>
                                    <asp:Label ID="Label1" runat="server" Text='<%# Bind("捆号") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="65px" />
                            </asp:TemplateField>
                            
                           <asp:TemplateField HeaderText="产品类别" SortExpression="品名">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text='<%# Bind("品名") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="生产分厂" SortExpression="生产线">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("生产线") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>  
                            
                            <asp:TemplateField HeaderText="原料供货" SortExpression="原料供货">
                                <ItemTemplate>
                                    <asp:Label ID="Label3" runat="server" Text='<%# Bind("原料供货") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="100px" />
                            </asp:TemplateField>  

                           <asp:TemplateField HeaderText="炉号" SortExpression="炉号">
                                <ItemTemplate>
                                    <asp:Label ID="Label4" runat="server" Text='<%# Eval("炉号") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="80px" />
                            </asp:TemplateField>

                            <asp:TemplateField HeaderText="捆重量(kg)" SortExpression="重量">
                                <ItemTemplate>
                                    <asp:Label ID="Label5" runat="server" Text='<%# Eval("重量") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="70px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="捆长度(m)" SortExpression="长度">
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" Text='<%# Eval("长度") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="70px" />
                            </asp:TemplateField>
                            
                           <asp:TemplateField HeaderText="支数" SortExpression="支数">
                                <ItemTemplate>
                                    <asp:Label ID="Label6" runat="server" Text='<%# Eval("支数") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="40px" />
                            </asp:TemplateField>
                            
                            <asp:TemplateField HeaderText="入库序号" SortExpression="入库序号">
                                <ItemTemplate>
                                    <asp:Label ID="Label9" runat="server" Text='<%# Eval("入库序号") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
                            </asp:TemplateField>  
                            
                            <asp:TemplateField HeaderText="出库序号" SortExpression="出库序号">
                                <ItemTemplate>
                                    <asp:Label ID="Label10" runat="server" Text='<%# Eval("出库序号") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="50px" />
                            </asp:TemplateField>  
                            
                            <asp:TemplateField HeaderText="入库日期" SortExpression="入库日期">
                                <ItemTemplate>
                                    <asp:Label ID="Label7" runat="server" Text='<%# Eval("入库日期","{0:d}") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="70px" />
                            </asp:TemplateField>  
                            
                            <asp:TemplateField HeaderText="出库日期" SortExpression="出库日期">
                                <ItemTemplate>
                                    <asp:Label ID="Label8" runat="server" Text='<%# Eval("出库日期","{0:d}") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="70px" />
                            </asp:TemplateField>  
                           <asp:TemplateField HeaderText="状态">
                                <ItemTemplate>
                                    <asp:Label ID="Label_zt" runat="server" Text='<%# Eval("状态") %>'></asp:Label>
                                </ItemTemplate>
                                <HeaderStyle CssClass="grid-header" />
                                <ItemStyle CssClass="grid" HorizontalAlign="Center" Width="40px" />
                            </asp:TemplateField>


                        </Columns>
                        <SelectedRowStyle CssClass="grid-row-selected" />
                      </asp:GridView>
	            </td>
            </tr>
            <tr>
	            <td>   
	                <table width="100%">
	                    <tr>
	                        <td class="pagebar">
                                <asp:Button ID="Button_Pager_First" UseSubmitBehavior="false" runat="server" Text="" ToolTip="首页" 
                                    CssClass="pageturn-first-b" onclick="Pager_Click" CommandName="--" />
                                <asp:Button ID="Button_Pager_Prev" UseSubmitBehavior="false" runat="server" Text="" ToolTip="上一页" 
                                    CssClass="pageturn-prev-b" onclick="Pager_Click" CommandName="-" />
                                <input type="button" class="page-split" UseSubmitBehavior="false" disabled />第<asp:TextBox 
                                    ID="TextBox_Pager" AutoPostBack="True" runat="server" CssClass="pageturn" 
                                    ontextchanged="Pager_Click"></asp:TextBox>页<input type="button" class="page-split" disabled /><asp:Label ID="Label_Pages" UseSubmitBehavior="false" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                                
                                <asp:Button ID="Button_Pager_Next" UseSubmitBehavior="false" runat="server" Text="" ToolTip="下一页" 
                                    CssClass="pageturn-next-b" onclick="Pager_Click" CommandName="+" />
                                <asp:Button ID="Button_Pager_Last" UseSubmitBehavior="false" runat="server" Text="" ToolTip="末页" 
                                    CssClass="pageturn-last-b" onclick="Pager_Click" CommandName="++" /><asp:Label ID="Label9" runat="server"></asp:Label><input type="button" class="page-split" disabled />
                            </td>
                            <td class="pagebar" align="right">
                                <asp:Label ID="Label_Total" runat="server"></asp:Label>
                            </td>
                        </tr>
                   </table>

	            </td>
            </tr>
        </table>
        

    </div>
</div>

</form>

<script>
    var textboxs = document.getElementsByTagName("input");
    var i;
    for (i = 0; i < textboxs.length; i++) {
        if (textboxs[i].className == "pageturn" || textboxs[i].className == "intxt1" || textboxs[i].className == "textbox") {
            textboxs[i].onfocus = function(e) { this.select(); };
        }
    }
    document.onkeydown = function(e) {
        if (!e) e = window.event;
        var tag = e.srcElement;
        if (!tag) tag = e.target;
        if (tag.tagName == "INPUT" && tag.className == "textbox" || tag.tagName == "SELECT") {
            if (e.keyCode == 13) e.keyCode = 9;
        }
    }
</script>
</body>
</html>
